home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ultra Mac Games 1 & 2
/
UltraMacGames1.iso
/
Dungeon
/
Ancient b7.0
/
spellsD
/
stack.txt
< prev
Wrap
Text File
|
1994-03-26
|
12KB
|
416 lines
-- stack: in
-- format: 10 (HyperCard 2)
-- flags: 0x1000 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=480 h=304
-- scroll: x=0 y=0
-- background count: 1
-- first background id: 2714
-- card count: 1
-- first card id: 2957
-- list block id: 2148
-- print block id: 0
-- font table block id: 3343
-- style table block id: 3094
-- free block count: 1
-- free size: 672 bytes
-- total size: 16384 bytes
-- stack block size: 12800 bytes
-- created by hypercard version: 0x02108001
-- compacted by hypercard version: 0x02108001
-- modified by hypercard version: 0x02108001
-- opened by hypercard version: 0x02108001
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x8000000008000000
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0x8888222288882222
-- patterns[4]: 0x88AA22AA88AA22AA
-- patterns[5]: 0xCCAA33AACCAA33AA
-- patterns[6]: 0xEEAABBAAEEAABBAA
-- patterns[7]: 0xEEBBBBEEEEBBBBEE
-- patterns[8]: 0xFFBBFFEEFFBBFFEE
-- patterns[9]: 0xFFBBFFFFFFBBFFFF
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0xE1D8470F
----- HyperTalk script -----
function heelhrm2 who,caster
Global Names,otoHit,toEvade,hits,condition,ohits,omhits
put needsHealing() into who
if who=0 then -- attack
put getMagicUser() into who
put "get harm("&who*-1&","&caster&")" into castSpell
do castspell
else -- heal
add random(8) to line who of ohits
if line who of ohits>line who of omhits then
put line who of omhits into line who of ohits
end if
get "heals a member of its party"
end if
return it
end heelhrm2
--castASpell(who*-1,caster,dmg)
function first who,caster,dmg -- Monster only
Global Names,condition,toEvade
Global otoHit,Hits,odmg,battleRnd,deadtypes
if candothings(caster*-1) then -- active
repeat with p=1 to the number of lines in condition
if line p of condition is not in deadtypes then exit repeat
end repeat
put line P of Names into thisP
if playerisActive(p) then
if candothings(p) then put 1 into M else put 0 into M
multiply who by -1
if random(line who of otoHit+battlernd)>=random(M*line p of toEvade) then -- a hit!
put (line caster of odmg)*(m-2) into dmg
subtract random(dmg) from line p of hits
if line p of hits<=0 then -- dead
return "kill" && thisP
else
return "hits the" && thisP && "for" && dmg
end if
else
return "misses" && thisPs
end if
else
return "hits" && thisP && "who is" && line p of condition
end if
else
return "is unable to attack"
end if
end first
function weakest who,caster,dmg
Global Names,condition,toEvade,otoHit,Hits,odmg,battleRnd,deadtypes
if candothings(caster*-1) then
put getWeakest() into p
put line P of Names into thisP
if playerisActive(p) then
if candothings(p) then put 1 into M else put 0 into M
if random(line caster of otoHit+battlernd)>=random(M*line p of toEvade) then -- a hit!
put (line caster of odmg)*(m-2)*-1 into dmg
put random(dmg) into dmg
subtract dmg from line p of hits
put line p of hits into line p of fld "hits"
if line p of hits<=0 then -- dead
put "dead" into line p of condition
return "kills"&&thisP
else
return "hits"&&thisP&&"for"&&dmg
end if
else
return "misses"&&thisP
end if
else
return "hits"&&thisP&&"who is"&&line p of condition
end if
else
return "is unable to attack"&&thisP
end if
end weakest
function getWeakest
Global condition,hits
put empty into hitList
repeat with p=1 to the number of lines in condition
if playerisActive(p) then
put line p of hits&"."&p&return after hitList
end if
end repeat
sort hitList numeric
put line 1 of hitList into p
put (p-trunc(p))*10 into p
return p
end getWeakest
function heelhrm1 who,caster,dmg
Global Names,oNames,condition,ocondition,toEvade
Global otoHit,oHits,omHits,Hits,oSpellPts
put needsHealing() into W
if playerisActive(caster*-1) then
if W=0 or line caster of oSpellPts<=0 then
put getActivePlayer() into P
if p<1 then put 1 into p
put line P of Names into thisP
if candothings(p) then put 1 into M else put 0 into M
if random(dmg*4)>random(M*line P of toEvade) then
put abs(M-2)*dmg into dmg -- double for cantdothings
subtract dmg from line P of Hits
if line P of Hits<=0 then -- dead
put "dead" into line P of condition
return "kills" && thisP
else
return "hits" && thisP && "for" && dmg
end if
else
return "misses" && thisP
end if
else -- heal the party member
add dice(2,6) to line W of ohits
if line W of oHits>line W of omHits then
put line W of omHits into line W of oHits
end if
if line W of oHits>line W of omhits+12 then debug checkpoint
subtract 1 from line caster of oSpellPts
return "heals a member of its party"
end if
else
return "is" && line caster of ocondition
end if
end heelhrm1
--O or P,lineNumber,stat,dmg,delay,duration,text
function asid who,caster
GLOBAL oHits,oNames,hits,ohits,toHit,toEvade,otoHit,otoEvade,Names,battleRnd
put Dice(2,2) into Dmg
if candoThings(who) then put 1 into M else put 0 into M
put dmg*abs(M-2) into dmg
if who<0 then
multiply who by -1
put line who of Names into thisP
if random(line caster of otoHit+battleRnd)>random(M*line who of toEvade) then
subtract dmg from line who of Hits
get "P," & who & ",hits,-1,1,5,is burned by acid"
put the number of lines in cd fld "actionPerRound" into L
put it into line L+1 of cd fld "actionPerRound"
if playerisactive(who) then
get "'s acid burns" && thisP && "for" && Dmg
else
get "hits" && thisP &", who is" && line who of condition
end if
else
get "misses" && thisP
end if
else
put "the" && line who of oNames into thisOne
put line caster of Names into thisP
if random(line caster of toHit+battleRnd)>random(M*line who of otoEvade) then
subtract Dmg from line who of oHits
get "O," & who & ",hits,-1,1,5,is burned by acid for 1"
put the number of lines in cd fld "actionPerRound" into L
put it into line L+1 of cd fld "actionPerRound"
if playerisactive(who*-1) then
get thisP & "'s acid burns" && thisOne && "for" && Dmg
else
get thisP && "throws acid at" && thisOne & ",who is" && line who of ocondition
end if
else
get thisP && "misses" && thisOne
end if
end if
return it
end asid
function attParalyzed who,caster
GLOBAL oCondition,oNames,Condition,Names,toHitMg,toEvade,otoHit
Global oToEvade,battleRnd,hits,ohits,odmg
put "The" && line caster of oNames into P
put line caster of odmg into dmg
if Condition contains "Paralyzed" then -- attack
put line 1 of getParalyzedP(Condition) into who
put line who of Names into T
if playerisActive(who) then
if candothings(who) then
put 1 into M
put random(dmg) into dmg
else
put 0 into M
put dmg*2 into dmg
end if
if random(line caster of otoHit+battleRnd)>M*random(line who of toEvade) then
subtract dmg from line who of hits
if line who of hits<=0 then
put "dead" into line who of condition
get "kills" && T
else
get "hits" && T && "for" && dmg
end if
else
get "misses" && T
end if
else
get "is unable to attack" && T
end if
return it
else -- paralyze
-- spell form is: name(who*-1,caster,dmg)
put getActivePlayer() into P
put "get paralyze"&"("&P*-1&","&caster&")" into castSpell
do castSpell
end if
return it
end attParalyzed
function getParalyzedP
global Condition
put empty into list
repeat with p=1 to the number of lines in Condition
if line p of condition contains "Paralyzed"
then put p & return before list
end repeat
return list
end getParalyzedP
function BlueWiz who,caster
Global potions,Names,hits,oHits,omhits,condition,ocondition,ospellPts
put line caster of oSpellPts into sp
if line caster of oHits<=10 then -- heal flee
put "flee" into line caster of oCondition
get "flees to save itself"
else if line caster of oHits<20 and sp>1 then -- heal self
add random(8)+4 to line caster of oHits
if line caster of ohits>line caster of omhits
then put line caster of omhits into line caster of ohits
subtract 1 from line caster of oSpellPts
get "heals itself"
else -- attack
put getWeakest() into p
get grenade(p*-1,caster)
end if
return it
end BlueWiz
function Witch3 who,caster
Global ohits,omhits,oCondition,Class,condition,hits,mhits,Names
put 0 into inNeed
repeat with i=1 to the number of lines in ohits
if line i of ohits<=line i of omhits/2 then
if playerisActive(i*-1) then add 1 to inNeed
end if
end repeat
if inNeed>=2 and line caster of oSpellPts>0 then
get healparty(-1,caster)
else if condition contains "paralyzed" then
put getParalyzed() into list
repeat with i=1 to the number of lines in list
put line i of list into p
if line p of Class="Mage" or line p of Class="Cleric" then
-- attack mage
put (random(4)+1)*2 into dmg
subtract dmg from line p of hits
if line p of hits<=0 then
get "killed"&&line p of Names
put "dead" into line p of condition
else
get "hits"&&line p of Names&&"for"&&dmg
end if
end if
end repeat
else -- harmParty
get harmParty(-1,caster)
end if
return it
end Witch3
function xDrain who,caster,p
Global Names,hits,toEvade,spellPts,permanentSpells,condition
Global oNames,otoHit,oSpells,odmg
if p is not a number then -- choose who to attack
put getActivePlayer() into p
end if
put line p of Names into T
if candoThings(p) then put 1 into M else put 0 into M
if random(line caster of otoHit)>M*random(line p of toEvade) then -- hit
put line caster of odmg into xdmg
if M=0 then put xdmg*2 into dmg else put random(xdmg) into dmg
subtract dmg from line p of hits
get "hits"&&T&&"for"&&dmg
if line p of hits<=0 then -- dead
put "dead" into line p of condition
put "dead" into line p of fld "condition"
get "killed"&&T
else -- hit
if line p of spellPts>0 then
subtract dice(2,4) from line p of spellPts
if line p of spellPts<0 then put 0 into line p of spellPts
get "also drains"&&T&&"of spell pts."&return&it
end if
end if
else -- miss
get "missed"&&T
end if
return it
end xDrain
function xHome who,caster
Global Names,condition,toEvade,otoHit
multiply who by -1
put line who of Names into P
if candothings(who) then put 1 into M else put 0 into M
if random(line caster of otoHit)>M*random(line who of toEvade) then
put "Home" into line who of condition
lock screen
push cd
go cd P
put "Andelair" into line 22 of fld "Stats"
pop cd
unlock screen
get "has sent"&&P&&"Home"
else -- missed
get "tries to send"&&P&&"Home"
end if
return it
end xHome
function Raise w,c
global oNames,ohits,omhits,ocondition,oSpellPts
put empty into list
repeat with m=1 to the number of lines in oHits
if line m of oCondition="dead" then put m&return after list
end repeat
if list≠"" then -- raise
put random(the number of lines in list) into L
put line L of list into M
put "Good" into line M of oCondition
subtract 1 from line c of oSpellPts
put line M of omHits into line m of oHits
get "raises the"&&line m of oNames
else
get weakest(w,c,14) -- attack weakest
end if
return it
end Raise